Skip to content

fix(web): allow closing diff panel in non-git projects#2413

Merged
juliusmarminge merged 1 commit intopingdotgg:mainfrom
pedrokpp:fix/close-diff-non-git-project
Apr 30, 2026
Merged

fix(web): allow closing diff panel in non-git projects#2413
juliusmarminge merged 1 commit intopingdotgg:mainfrom
pedrokpp:fix/close-diff-non-git-project

Conversation

@pedrokpp
Copy link
Copy Markdown
Contributor

@pedrokpp pedrokpp commented Apr 30, 2026

What Changed

  • keep the diff toggle enabled when the diff panel is already open, even if the active project is not a git repository
  • keep the existing disabled state for non-git projects when the diff panel is closed
  • keep the tooltip in the normal toggle state while the panel is open so the user can still close it

Why

If you open the diff panel in a git-backed project and then switch to an already existing thread whose project does not have git, the panel stays open but the header toggle becomes disabled. That traps the panel in an open state.

Opening a new thread already closes the diff panel properly. The broken case is specifically switching to another existing thread where the diff panel remains open across navigation.

This fix stays small and local to the header control: if the panel is currently enabled, it must also be possible to disable it.

Related to #937, but this is a different close-path regression.


Note

Low Risk
Small, localized UI-state change to toggle/tooltip gating; no backend, data, or security impact.

Overview
Fixes a UI trap where the diff panel could remain open after switching to a non-git project by keeping the diff toggle enabled while diffOpen is true.

Updates the tooltip logic to only show the “not a git repository” message when the panel is closed, allowing users to close the diff panel even when isGitRepo is false.

Reviewed by Cursor Bugbot for commit 2e3d5bd. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Fix diff panel toggle to allow closing in non-git projects

In ChatHeader.tsx, the diff toggle button was always disabled for non-git repos, trapping users with an open diff panel they couldn't close. The disabled condition and tooltip now check both !isGitRepo and !diffOpen, so the toggle stays enabled when the panel is open regardless of git status.

Macroscope summarized 2e3d5bd.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 30, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: d412e9b7-70df-4b2a-96af-865cafe2a4bc

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels Apr 30, 2026
@macroscopeapp
Copy link
Copy Markdown
Contributor

macroscopeapp Bot commented Apr 30, 2026

Approvability

Verdict: Approved

Simple UI bug fix that adds a condition to allow closing an already-open diff panel in non-git projects. The change is minimal, self-contained, and has clear intent with no side effects.

You can customize Macroscope's approvability policy. Learn more.

@juliusmarminge juliusmarminge enabled auto-merge (squash) April 30, 2026 04:31
@juliusmarminge juliusmarminge merged commit 86c94b4 into pingdotgg:main Apr 30, 2026
12 checks passed
@pedrokpp pedrokpp deleted the fix/close-diff-non-git-project branch April 30, 2026 10:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS 0-9 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants